package com.cantierinformatici.mygym;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class ListAdapter extends BaseAdapter {

	String[] items = new String[] { "Title1", "Title2", "Title3", "Title4",
			"Title5", "Title 6", "Title 7" };

	@Override
	public int getCount() {
		return items.length;
	}

	@Override
	public Object getItem(int position) {
		return items[position];
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// setup our row
		TextView text = (TextView) convertView.findViewById(R.id.home_list_text);
		text.setText(items[position]);
		ImageView image = (ImageView) convertView.findViewById(R.id.home_list_image);
		
		image.setImageResource(R.drawable.ic_labels);
		TextView textnumber = (TextView) convertView
				.findViewById(R.id.home_list_textnumber);
		textnumber.setText("" + position);
		return convertView;
	}
}
